<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: cv::ml::EM Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="navpath" id="nav-path">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../d8/df1/namespacecv_1_1ml.html">ml</a></li><li class="navelem"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html">EM</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="../../d8/d68/classcv_1_1ml_1_1EM-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::ml::EM Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="../../dd/ded/group__ml.html">Machine Learning</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>The class implements the Expectation Maximization algorithm.  
 <a href="../../d1/dfb/classcv_1_1ml_1_1EM.html#details">More...</a></p>
<p><code>#include &lt;opencv2/ml.hpp&gt;</code></p>
<div class="dynheader">
Inheritance diagram for cv::ml::EM:</div>
<div class="dyncontent">
 <div class="center">
  <img alt="" src="../../d1/dfb/classcv_1_1ml_1_1EM.png" usemap="#cv::ml::EM_map"/>
  <map id="cv::ml::EM_map" name="cv::ml::EM_map">
<area alt="cv::ml::StatModel" coords="0,56,106,80" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html" shape="rect" title="Base class for statistical models in OpenCV ML. "/>
<area alt="cv::Algorithm" coords="0,0,106,24" href="../../d3/d46/classcv_1_1Algorithm.html" shape="rect" title="This is a base class for all more or less complex algorithms in OpenCV. "/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a62c251978c1193da39d6e36f015723af"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a62c251978c1193da39d6e36f015723afa19593ad7143e258ab5f7cb0174f3403a">DEFAULT_NCLUSTERS</a> =5, 
<br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a62c251978c1193da39d6e36f015723afa1e62e599654778422db115bccb56c40a">DEFAULT_MAX_ITERS</a> =100
<br/>
 }<tr class="memdesc:a62c251978c1193da39d6e36f015723af"><td class="mdescLeft"> </td><td class="mdescRight">Default parameters.  <a href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a62c251978c1193da39d6e36f015723af">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:a62c251978c1193da39d6e36f015723af"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a61db1e474e616e72099d9153cd6ffc10"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a61db1e474e616e72099d9153cd6ffc10abade5584fe2152c34ea1ee175691f98c">START_E_STEP</a> =1, 
<br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a61db1e474e616e72099d9153cd6ffc10a628d2a6f1e5bb6dd0dd1847345d968d2">START_M_STEP</a> =2, 
<br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a61db1e474e616e72099d9153cd6ffc10a5d4e8becb341736fc233b0dc1918ac94">START_AUTO_STEP</a> =0
<br/>
 }<tr class="memdesc:a61db1e474e616e72099d9153cd6ffc10"><td class="mdescLeft"> </td><td class="mdescRight">The initial step.  <a href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a61db1e474e616e72099d9153cd6ffc10">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:a61db1e474e616e72099d9153cd6ffc10"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad993005b665024ea3c067c4cccd4e898"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898">Types</a> { <br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898a5e6f007058bf35fdd639811be7320f01">COV_MAT_SPHERICAL</a> =0, 
<br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898ab5fdfaa68417f5f0d2b147c6fded361d">COV_MAT_DIAGONAL</a> =1, 
<br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898a4d6181530b2faaed9bbf8ba9e9ce25d9">COV_MAT_GENERIC</a> =2, 
<br/>
  <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898a058904bf7cacd90252c8e3499f3abfaa">COV_MAT_DEFAULT</a> =COV_MAT_DIAGONAL
<br/>
 }<tr class="memdesc:ad993005b665024ea3c067c4cccd4e898"><td class="mdescLeft"> </td><td class="mdescRight">Type of covariation matrices.  <a href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:ad993005b665024ea3c067c4cccd4e898"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_types_classcv_1_1ml_1_1StatModel"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classcv_1_1ml_1_1StatModel')"><img alt="-" src="../../closed.png"/> Public Types inherited from <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html">cv::ml::StatModel</a></td></tr>
<tr class="memitem:af1ea864e1c19796e6264ebb3950c0b9a inherit pub_types_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9a">Flags</a> { <br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aa397fde9eaadd4efb07af6a7fbacea6cd">UPDATE_MODEL</a> = 1, 
<br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aa639a8ea2b61c2bf03f87cf4c4a5bd824">RAW_OUTPUT</a> =1, 
<br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aae860ef9fda481bb6730e8794009c99b5">COMPRESSED_INPUT</a> =2, 
<br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aa0cdfa2b3b9c5947d9a80bcca7eac485f">PREPROCESSED_INPUT</a> =4
<br/>
 }</td></tr>
<tr class="separator:af1ea864e1c19796e6264ebb3950c0b9a inherit pub_types_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae914b688d7546847e4919ac4e005a0fe"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ae914b688d7546847e4919ac4e005a0fe">getClustersNumber</a> () const =0</td></tr>
<tr class="separator:ae914b688d7546847e4919ac4e005a0fe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae30ad8cb14ec43c524ca8086ac0f9e5f"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ae30ad8cb14ec43c524ca8086ac0f9e5f">getCovarianceMatrixType</a> () const =0</td></tr>
<tr class="separator:ae30ad8cb14ec43c524ca8086ac0f9e5f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a223e28d9c8a2447d6afca6a10dd608c1"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a223e28d9c8a2447d6afca6a10dd608c1">getCovs</a> (std::vector&lt; <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &gt; &amp;covs) const =0</td></tr>
<tr class="memdesc:a223e28d9c8a2447d6afca6a10dd608c1"><td class="mdescLeft"> </td><td class="mdescRight">Returns covariation matrices.  <a href="#a223e28d9c8a2447d6afca6a10dd608c1">More...</a><br/></td></tr>
<tr class="separator:a223e28d9c8a2447d6afca6a10dd608c1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acec62dd55c06711c81d741c2d96603d1"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#acec62dd55c06711c81d741c2d96603d1">getMeans</a> () const =0</td></tr>
<tr class="memdesc:acec62dd55c06711c81d741c2d96603d1"><td class="mdescLeft"> </td><td class="mdescRight">Returns the cluster centers (means of the Gaussian mixture)  <a href="#acec62dd55c06711c81d741c2d96603d1">More...</a><br/></td></tr>
<tr class="separator:acec62dd55c06711c81d741c2d96603d1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a80d9ab289b98dfc51f033fd2227bef3e"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a80d9ab289b98dfc51f033fd2227bef3e">getTermCriteria</a> () const =0</td></tr>
<tr class="separator:a80d9ab289b98dfc51f033fd2227bef3e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af235d6061a5414ebf6defddf7cc070e1"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#af235d6061a5414ebf6defddf7cc070e1">getWeights</a> () const =0</td></tr>
<tr class="memdesc:af235d6061a5414ebf6defddf7cc070e1"><td class="mdescLeft"> </td><td class="mdescRight">Returns weights of the mixtures.  <a href="#af235d6061a5414ebf6defddf7cc070e1">More...</a><br/></td></tr>
<tr class="separator:af235d6061a5414ebf6defddf7cc070e1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae3f12147ba846a53601b60c784ee263d"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ae3f12147ba846a53601b60c784ee263d">predict</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> results=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), int flags=0) const <a class="el" href="../../db/de0/group__core__utils.html#ga4d89d63e402ef9ddc48e18e21180fe4a">CV_OVERRIDE</a>=0</td></tr>
<tr class="memdesc:ae3f12147ba846a53601b60c784ee263d"><td class="mdescLeft"> </td><td class="mdescRight">Returns posterior probabilities for the provided samples.  <a href="#ae3f12147ba846a53601b60c784ee263d">More...</a><br/></td></tr>
<tr class="separator:ae3f12147ba846a53601b60c784ee263d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2ea7da92a75bc7a7d665c241f547b9b9"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../dc/d84/group__core__basic.html#gaf20d857c2077c986d3b303e3d58bbc54">Vec2d</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a2ea7da92a75bc7a7d665c241f547b9b9">predict2</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> sample, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> probs) const =0</td></tr>
<tr class="memdesc:a2ea7da92a75bc7a7d665c241f547b9b9"><td class="mdescLeft"> </td><td class="mdescRight">Returns a likelihood logarithm value and an index of the most probable mixture component for the given sample.  <a href="#a2ea7da92a75bc7a7d665c241f547b9b9">More...</a><br/></td></tr>
<tr class="separator:a2ea7da92a75bc7a7d665c241f547b9b9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a069ee46c360ed183d5eb96b8b8261d8a"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a069ee46c360ed183d5eb96b8b8261d8a">setClustersNumber</a> (int val)=0</td></tr>
<tr class="separator:a069ee46c360ed183d5eb96b8b8261d8a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8b383c62697eac9a972931674790f6cd"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a8b383c62697eac9a972931674790f6cd">setCovarianceMatrixType</a> (int val)=0</td></tr>
<tr class="separator:a8b383c62697eac9a972931674790f6cd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab516e6f125bd4ebc976306e956320313"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ab516e6f125bd4ebc976306e956320313">setTermCriteria</a> (const <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> &amp;val)=0</td></tr>
<tr class="separator:ab516e6f125bd4ebc976306e956320313"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d02b45a574d51a72263e9c53cdc4f09"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a2d02b45a574d51a72263e9c53cdc4f09">trainE</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> means0, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> covs0=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> weights0=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> logLikelihoods=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> labels=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> probs=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>())=0</td></tr>
<tr class="memdesc:a2d02b45a574d51a72263e9c53cdc4f09"><td class="mdescLeft"> </td><td class="mdescRight">Estimate the Gaussian mixture parameters from a samples set.  <a href="#a2d02b45a574d51a72263e9c53cdc4f09">More...</a><br/></td></tr>
<tr class="separator:a2d02b45a574d51a72263e9c53cdc4f09"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5a6a7badbc0c85a8c9fa50a41bf1bcd2"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a5a6a7badbc0c85a8c9fa50a41bf1bcd2">trainEM</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> logLikelihoods=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> labels=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> probs=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>())=0</td></tr>
<tr class="memdesc:a5a6a7badbc0c85a8c9fa50a41bf1bcd2"><td class="mdescLeft"> </td><td class="mdescRight">Estimate the Gaussian mixture parameters from a samples set.  <a href="#a5a6a7badbc0c85a8c9fa50a41bf1bcd2">More...</a><br/></td></tr>
<tr class="separator:a5a6a7badbc0c85a8c9fa50a41bf1bcd2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac21fbae3a09972de0a0a1cb4c2c434d0"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ac21fbae3a09972de0a0a1cb4c2c434d0">trainM</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> probs0, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> logLikelihoods=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> labels=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> probs=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>())=0</td></tr>
<tr class="memdesc:ac21fbae3a09972de0a0a1cb4c2c434d0"><td class="mdescLeft"> </td><td class="mdescRight">Estimate the Gaussian mixture parameters from a samples set.  <a href="#ac21fbae3a09972de0a0a1cb4c2c434d0">More...</a><br/></td></tr>
<tr class="separator:ac21fbae3a09972de0a0a1cb4c2c434d0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classcv_1_1ml_1_1StatModel"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcv_1_1ml_1_1StatModel')"><img alt="-" src="../../closed.png"/> Public Member Functions inherited from <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html">cv::ml::StatModel</a></td></tr>
<tr class="memitem:aa6a71b1ee5b7fa0b07b55e77106cda13 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aa6a71b1ee5b7fa0b07b55e77106cda13">calcError</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; &amp;data, bool test, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> resp) const</td></tr>
<tr class="memdesc:aa6a71b1ee5b7fa0b07b55e77106cda13 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Computes error on the training or test dataset.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aa6a71b1ee5b7fa0b07b55e77106cda13">More...</a><br/></td></tr>
<tr class="separator:aa6a71b1ee5b7fa0b07b55e77106cda13 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a80afceed1710367d32d6232374162b97 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a80afceed1710367d32d6232374162b97">empty</a> () const <a class="el" href="../../db/de0/group__core__utils.html#ga4d89d63e402ef9ddc48e18e21180fe4a">CV_OVERRIDE</a></td></tr>
<tr class="memdesc:a80afceed1710367d32d6232374162b97 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html" title="This is a base class for all more or less complex algorithms in OpenCV. ">Algorithm</a> is empty (e.g. in the very beginning or after unsuccessful read.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a80afceed1710367d32d6232374162b97">More...</a><br/></td></tr>
<tr class="separator:a80afceed1710367d32d6232374162b97 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a783b92c436c7a2978e2d4bbb3cfb6e0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a783b92c436c7a2978e2d4bbb3cfb6e0c">getVarCount</a> () const =0</td></tr>
<tr class="memdesc:a783b92c436c7a2978e2d4bbb3cfb6e0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of variables in training samples.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a783b92c436c7a2978e2d4bbb3cfb6e0c">More...</a><br/></td></tr>
<tr class="separator:a783b92c436c7a2978e2d4bbb3cfb6e0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1121a835feedefdcdb8624966567aec6 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1121a835feedefdcdb8624966567aec6">isClassifier</a> () const =0</td></tr>
<tr class="memdesc:a1121a835feedefdcdb8624966567aec6 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the model is classifier.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1121a835feedefdcdb8624966567aec6">More...</a><br/></td></tr>
<tr class="separator:a1121a835feedefdcdb8624966567aec6 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aab380b59eb30b50254ef1b804774c4d8 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aab380b59eb30b50254ef1b804774c4d8">isTrained</a> () const =0</td></tr>
<tr class="memdesc:aab380b59eb30b50254ef1b804774c4d8 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the model is trained.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aab380b59eb30b50254ef1b804774c4d8">More...</a><br/></td></tr>
<tr class="separator:aab380b59eb30b50254ef1b804774c4d8 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af96a0e04f1677a835cc25263c7db3c0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c">train</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; &amp;trainData, int flags=0)</td></tr>
<tr class="memdesc:af96a0e04f1677a835cc25263c7db3c0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Trains the statistical model.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c">More...</a><br/></td></tr>
<tr class="separator:af96a0e04f1677a835cc25263c7db3c0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aeb25a75f438864fb25af182fb4b1b96f inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aeb25a75f438864fb25af182fb4b1b96f">train</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, int layout, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> responses)</td></tr>
<tr class="memdesc:aeb25a75f438864fb25af182fb4b1b96f inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Trains the statistical model.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aeb25a75f438864fb25af182fb4b1b96f">More...</a><br/></td></tr>
<tr class="separator:aeb25a75f438864fb25af182fb4b1b96f inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Public Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a827c8b2781ed17574805f373e6054ff1 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a827c8b2781ed17574805f373e6054ff1">Algorithm</a> ()</td></tr>
<tr class="separator:a827c8b2781ed17574805f373e6054ff1 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8ae826127fa0f1f8d10a24841bd376f8 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a8ae826127fa0f1f8d10a24841bd376f8">~Algorithm</a> ()</td></tr>
<tr class="separator:a8ae826127fa0f1f8d10a24841bd376f8 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#aec9c965448e4dc851d7cacd3abd84cd1">clear</a> ()</td></tr>
<tr class="memdesc:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Clears the algorithm state.  <a href="../../d3/d46/classcv_1_1Algorithm.html#aec9c965448e4dc851d7cacd3abd84cd1">More...</a><br/></td></tr>
<tr class="separator:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a286fc82744ccab3d248aca44524266a9 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a286fc82744ccab3d248aca44524266a9">getDefaultName</a> () const</td></tr>
<tr class="separator:a286fc82744ccab3d248aca44524266a9 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#aef2ad3f4145bd6e8c3664eb1c4b5e1e6">read</a> (const <a class="el" href="../../de/dd9/classcv_1_1FileNode.html">FileNode</a> &amp;fn)</td></tr>
<tr class="memdesc:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Reads algorithm parameters from a file storage.  <a href="../../d3/d46/classcv_1_1Algorithm.html#aef2ad3f4145bd6e8c3664eb1c4b5e1e6">More...</a><br/></td></tr>
<tr class="separator:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0a880744bc4e3f45711444571df47d67 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a0a880744bc4e3f45711444571df47d67">save</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filename) const</td></tr>
<tr class="separator:a0a880744bc4e3f45711444571df47d67 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a1f8ad7b8add515077367fb9949a174d2">write</a> (<a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &amp;fs) const</td></tr>
<tr class="memdesc:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Stores algorithm parameters in a file storage.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a1f8ad7b8add515077367fb9949a174d2">More...</a><br/></td></tr>
<tr class="separator:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a763a62d1b03042eef7d7fc3ac6c87c79">write</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &gt; &amp;fs, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;name=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>()) const</td></tr>
<tr class="memdesc:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">simplified API for language bindings This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a763a62d1b03042eef7d7fc3ac6c87c79">More...</a><br/></td></tr>
<tr class="separator:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a7725c8beba696cfcb6889cd5494101a4"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html">EM</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a7725c8beba696cfcb6889cd5494101a4">create</a> ()</td></tr>
<tr class="separator:a7725c8beba696cfcb6889cd5494101a4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a90eec814e087b4d8c3ff9e92f8069f6a"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html">EM</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a90eec814e087b4d8c3ff9e92f8069f6a">load</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filepath, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;nodeName=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a90eec814e087b4d8c3ff9e92f8069f6a"><td class="mdescLeft"> </td><td class="mdescRight">Loads and creates a serialized <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html" title="The class implements the Expectation Maximization algorithm. ">EM</a> from a file.  <a href="#a90eec814e087b4d8c3ff9e92f8069f6a">More...</a><br/></td></tr>
<tr class="separator:a90eec814e087b4d8c3ff9e92f8069f6a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_static_methods_classcv_1_1ml_1_1StatModel"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classcv_1_1ml_1_1StatModel')"><img alt="-" src="../../closed.png"/> Static Public Member Functions inherited from <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html">cv::ml::StatModel</a></td></tr>
<tr class="memitem:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af93a21ea5866cd305936a03742f69af8">train</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; &amp;data, int flags=0)</td></tr>
<tr class="memdesc:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Create and train model with default parameters.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af93a21ea5866cd305936a03742f69af8">More...</a><br/></td></tr>
<tr class="separator:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_static_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Static Public Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a623841c33b58ea9c4847da04607e067b">load</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filename, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;objname=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Loads algorithm from the file.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a623841c33b58ea9c4847da04607e067b">More...</a><br/></td></tr>
<tr class="separator:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a3ba305a10d02479c13cf7d169c321547">loadFromString</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;strModel, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;objname=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Loads algorithm from a String.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a3ba305a10d02479c13cf7d169c321547">More...</a><br/></td></tr>
<tr class="separator:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#ad8c591bacb34c485f5b7a250c314fc53">read</a> (const <a class="el" href="../../de/dd9/classcv_1_1FileNode.html">FileNode</a> &amp;fn)</td></tr>
<tr class="memdesc:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Reads algorithm from the file node.  <a href="../../d3/d46/classcv_1_1Algorithm.html#ad8c591bacb34c485f5b7a250c314fc53">More...</a><br/></td></tr>
<tr class="separator:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Protected Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a68eeca71617474ad3d4561786f0289d2 inherit pro_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a68eeca71617474ad3d4561786f0289d2">writeFormat</a> (<a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &amp;fs) const</td></tr>
<tr class="separator:a68eeca71617474ad3d4561786f0289d2 inherit pro_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The class implements the Expectation Maximization algorithm. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../dc/dd6/ml_intro.html#ml_intro_em">Expectation Maximization </a> </dd></dl>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a62c251978c1193da39d6e36f015723af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62c251978c1193da39d6e36f015723af">◆ </a></span>anonymous enum</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Default parameters. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a62c251978c1193da39d6e36f015723afa19593ad7143e258ab5f7cb0174f3403a"></a>DEFAULT_NCLUSTERS </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a62c251978c1193da39d6e36f015723afa1e62e599654778422db115bccb56c40a"></a>DEFAULT_MAX_ITERS </td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<a id="a61db1e474e616e72099d9153cd6ffc10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61db1e474e616e72099d9153cd6ffc10">◆ </a></span>anonymous enum</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The initial step. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a61db1e474e616e72099d9153cd6ffc10abade5584fe2152c34ea1ee175691f98c"></a>START_E_STEP </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a61db1e474e616e72099d9153cd6ffc10a628d2a6f1e5bb6dd0dd1847345d968d2"></a>START_M_STEP </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a61db1e474e616e72099d9153cd6ffc10a5d4e8becb341736fc233b0dc1918ac94"></a>START_AUTO_STEP </td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<a id="ad993005b665024ea3c067c4cccd4e898"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad993005b665024ea3c067c4cccd4e898">◆ </a></span>Types</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898">cv::ml::EM::Types</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Type of covariation matrices. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ad993005b665024ea3c067c4cccd4e898a5e6f007058bf35fdd639811be7320f01"></a>COV_MAT_SPHERICAL </td><td class="fielddoc"><p>A scaled identity matrix \(\mu_k * I\). There is the only parameter \(\mu_k\) to be estimated for each matrix. The option may be used in special cases, when the constraint is relevant, or as a first step in the optimization (for example in case when the data is preprocessed with <a class="el" href="../../d3/d8d/classcv_1_1PCA.html" title="Principal Component Analysis. ">PCA</a>). The results of such preliminary estimation may be passed again to the optimization procedure, this time with covMatType=<a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898ab5fdfaa68417f5f0d2b147c6fded361d">EM::COV_MAT_DIAGONAL</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad993005b665024ea3c067c4cccd4e898ab5fdfaa68417f5f0d2b147c6fded361d"></a>COV_MAT_DIAGONAL </td><td class="fielddoc"><p>A diagonal matrix with positive diagonal elements. The number of free parameters is d for each matrix. This is most commonly used option yielding good estimation results. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad993005b665024ea3c067c4cccd4e898a4d6181530b2faaed9bbf8ba9e9ce25d9"></a>COV_MAT_GENERIC </td><td class="fielddoc"><p>A symmetric positively defined matrix. The number of free parameters in each matrix is about \(d^2/2\). It is not recommended to use this option, unless there is pretty accurate initial estimation of the parameters and/or a huge number of training samples. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad993005b665024ea3c067c4cccd4e898a058904bf7cacd90252c8e3499f3abfaa"></a>COV_MAT_DEFAULT </td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7725c8beba696cfcb6889cd5494101a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7725c8beba696cfcb6889cd5494101a4">◆ </a></span>create()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html">EM</a>&gt; cv::ml::EM::create </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml.EM_create(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Creates empty EM model. The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you can use one of the <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c" title="Trains the statistical model. ">EM::train</a>* methods or load it from file using <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a623841c33b58ea9c4847da04607e067b" title="Loads algorithm from the file. ">Algorithm::load</a>&lt;<a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html" title="The class implements the Expectation Maximization algorithm. ">EM</a>&gt;(filename). </p>
</div>
</div>
<a id="ae914b688d7546847e4919ac4e005a0fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae914b688d7546847e4919ac4e005a0fe">◆ </a></span>getClustersNumber()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::EM::getClustersNumber </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_EM.getClustersNumber(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>The number of mixture components in the Gaussian mixture model. Default value of the parameter is <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a62c251978c1193da39d6e36f015723afa19593ad7143e258ab5f7cb0174f3403a">EM::DEFAULT_NCLUSTERS</a>=5. Some of EM implementation could determine the optimal number of mixtures within a specified value range, but that is not the case in ML yet. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a069ee46c360ed183d5eb96b8b8261d8a">setClustersNumber</a> </dd></dl>
</div>
</div>
<a id="ae30ad8cb14ec43c524ca8086ac0f9e5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae30ad8cb14ec43c524ca8086ac0f9e5f">◆ </a></span>getCovarianceMatrixType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::EM::getCovarianceMatrixType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_EM.getCovarianceMatrixType(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Constraint on covariance matrices which defines type of matrices. See <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ad993005b665024ea3c067c4cccd4e898" title="Type of covariation matrices. ">EM::Types</a>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a8b383c62697eac9a972931674790f6cd">setCovarianceMatrixType</a> </dd></dl>
</div>
</div>
<a id="a223e28d9c8a2447d6afca6a10dd608c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a223e28d9c8a2447d6afca6a10dd608c1">◆ </a></span>getCovs()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::EM::getCovs </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &gt; &amp; </td>
          <td class="paramname"><em>covs</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>covs</td><td>=</td><td>cv.ml_EM.getCovs(</td><td class="paramname">[, covs]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns covariation matrices. </p>
<p>Returns vector of covariation matrices. Number of matrices is the number of gaussian mixtures, each matrix is a square floating-point matrix NxN, where N is the space dimensionality. </p>
</div>
</div>
<a id="acec62dd55c06711c81d741c2d96603d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acec62dd55c06711c81d741c2d96603d1">◆ </a></span>getMeans()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::EM::getMeans </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_EM.getMeans(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the cluster centers (means of the Gaussian mixture) </p>
<p>Returns matrix with the number of rows equal to the number of mixtures and number of columns equal to the space dimensionality. </p>
</div>
</div>
<a id="a80d9ab289b98dfc51f033fd2227bef3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80d9ab289b98dfc51f033fd2227bef3e">◆ </a></span>getTermCriteria()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> cv::ml::EM::getTermCriteria </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_EM.getTermCriteria(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>The termination criteria of the EM algorithm. The EM algorithm can be terminated by the number of iterations termCrit.maxCount (number of M-steps) or when relative change of likelihood logarithm is less than termCrit.epsilon. Default maximum number of iterations is <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a62c251978c1193da39d6e36f015723afa1e62e599654778422db115bccb56c40a">EM::DEFAULT_MAX_ITERS</a>=100. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ab516e6f125bd4ebc976306e956320313">setTermCriteria</a> </dd></dl>
</div>
</div>
<a id="af235d6061a5414ebf6defddf7cc070e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af235d6061a5414ebf6defddf7cc070e1">◆ </a></span>getWeights()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::EM::getWeights </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_EM.getWeights(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns weights of the mixtures. </p>
<p>Returns vector with the number of elements equal to the number of mixtures. </p>
</div>
</div>
<a id="a90eec814e087b4d8c3ff9e92f8069f6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90eec814e087b4d8c3ff9e92f8069f6a">◆ </a></span>load()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html">EM</a>&gt; cv::ml::EM::load </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp; </td>
          <td class="paramname"><em>filepath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp; </td>
          <td class="paramname"><em>nodeName</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml.EM_load(</td><td class="paramname">filepath[, nodeName]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Loads and creates a serialized <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html" title="The class implements the Expectation Maximization algorithm. ">EM</a> from a file. </p>
<p>Use <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a0a880744bc4e3f45711444571df47d67">EM::save</a> to serialize and store an <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html" title="The class implements the Expectation Maximization algorithm. ">EM</a> to disk. Load the <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html" title="The class implements the Expectation Maximization algorithm. ">EM</a> from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filepath</td><td>path to serialized <a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html" title="The class implements the Expectation Maximization algorithm. ">EM</a> </td></tr>
    <tr><td class="paramname">nodeName</td><td>name of node containing the classifier </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ae3f12147ba846a53601b60c784ee263d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3f12147ba846a53601b60c784ee263d">◆ </a></span>predict()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual float cv::ml::EM::predict </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>samples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>results</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>flags</em> = <code>0</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, results</td><td>=</td><td>cv.ml_EM.predict(</td><td class="paramname">samples[, results[, flags]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns posterior probabilities for the provided samples. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">samples</td><td>The input samples, floating-point matrix </td></tr>
    <tr><td class="paramname">results</td><td>The optional output \( nSamples \times nClusters\) matrix of results. It contains posterior probabilities for each sample from the input </td></tr>
    <tr><td class="paramname">flags</td><td>This parameter will be ignored </td></tr>
  </table>
  </dd>
</dl>
<p>Implements <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1a7e49e1febd10392452727498771bc1">cv::ml::StatModel</a>.</p>
</div>
</div>
<a id="a2ea7da92a75bc7a7d665c241f547b9b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ea7da92a75bc7a7d665c241f547b9b9">◆ </a></span>predict2()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../dc/d84/group__core__basic.html#gaf20d857c2077c986d3b303e3d58bbc54">Vec2d</a> cv::ml::EM::predict2 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>sample</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>probs</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, probs</td><td>=</td><td>cv.ml_EM.predict2(</td><td class="paramname">sample[, probs]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns a likelihood logarithm value and an index of the most probable mixture component for the given sample. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sample</td><td>A sample for classification. It should be a one-channel matrix of \(1 \times dims\) or \(dims \times 1\) size. </td></tr>
    <tr><td class="paramname">probs</td><td>Optional output matrix that contains posterior probabilities of each component given the sample. It has \(1 \times nclusters\) size and CV_64FC1 type.</td></tr>
  </table>
  </dd>
</dl>
<p>The method returns a two-element double vector. Zero element is a likelihood logarithm value for the sample. First element is an index of the most probable mixture component for the given sample. </p>
</div>
</div>
<a id="a069ee46c360ed183d5eb96b8b8261d8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a069ee46c360ed183d5eb96b8b8261d8a">◆ </a></span>setClustersNumber()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::EM::setClustersNumber </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_EM.setClustersNumber(</td><td class="paramname">val</td><td>)</td></tr></table>
</div><div class="memdoc">
<p></p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ae914b688d7546847e4919ac4e005a0fe">getClustersNumber</a> </dd></dl>
</div>
</div>
<a id="a8b383c62697eac9a972931674790f6cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8b383c62697eac9a972931674790f6cd">◆ </a></span>setCovarianceMatrixType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::EM::setCovarianceMatrixType </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_EM.setCovarianceMatrixType(</td><td class="paramname">val</td><td>)</td></tr></table>
</div><div class="memdoc">
<p></p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#ae30ad8cb14ec43c524ca8086ac0f9e5f">getCovarianceMatrixType</a> </dd></dl>
</div>
</div>
<a id="ab516e6f125bd4ebc976306e956320313"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab516e6f125bd4ebc976306e956320313">◆ </a></span>setTermCriteria()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::EM::setTermCriteria </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> &amp; </td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_EM.setTermCriteria(</td><td class="paramname">val</td><td>)</td></tr></table>
</div><div class="memdoc">
<p></p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d1/dfb/classcv_1_1ml_1_1EM.html#a80d9ab289b98dfc51f033fd2227bef3e">getTermCriteria</a> </dd></dl>
</div>
</div>
<a id="a2d02b45a574d51a72263e9c53cdc4f09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d02b45a574d51a72263e9c53cdc4f09">◆ </a></span>trainE()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool cv::ml::EM::trainE </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>samples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>means0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>covs0</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>weights0</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>logLikelihoods</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>labels</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>probs</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, logLikelihoods, labels, probs</td><td>=</td><td>cv.ml_EM.trainE(</td><td class="paramname">samples, means0[, covs0[, weights0[, logLikelihoods[, labels[, probs]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Estimate the Gaussian mixture parameters from a samples set. </p>
<p>This variation starts with Expectation step. You need to provide initial means \(a_k\) of mixture components. Optionally you can pass initial weights \(\pi_k\) and covariance matrices \(S_k\) of mixture components.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">samples</td><td>Samples from which the Gaussian mixture model will be estimated. It should be a one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type it will be converted to the inner matrix of such type for the further computing. </td></tr>
    <tr><td class="paramname">means0</td><td>Initial means \(a_k\) of mixture components. It is a one-channel matrix of \(nclusters \times dims\) size. If the matrix does not have CV_64F type it will be converted to the inner matrix of such type for the further computing. </td></tr>
    <tr><td class="paramname">covs0</td><td>The vector of initial covariance matrices \(S_k\) of mixture components. Each of covariance matrices is a one-channel matrix of \(dims \times dims\) size. If the matrices do not have CV_64F type they will be converted to the inner matrices of such type for the further computing. </td></tr>
    <tr><td class="paramname">weights0</td><td>Initial weights \(\pi_k\) of mixture components. It should be a one-channel floating-point matrix with \(1 \times nclusters\) or \(nclusters \times 1\) size. </td></tr>
    <tr><td class="paramname">logLikelihoods</td><td>The optional output matrix that contains a likelihood logarithm value for each sample. It has \(nsamples \times 1\) size and CV_64FC1 type. </td></tr>
    <tr><td class="paramname">labels</td><td>The optional output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample). It has \(nsamples \times 1\) size and CV_32SC1 type. </td></tr>
    <tr><td class="paramname">probs</td><td>The optional output matrix that contains posterior probabilities of each Gaussian mixture component given the each sample. It has \(nsamples \times nclusters\) size and CV_64FC1 type. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="a5a6a7badbc0c85a8c9fa50a41bf1bcd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a6a7badbc0c85a8c9fa50a41bf1bcd2">◆ </a></span>trainEM()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool cv::ml::EM::trainEM </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>samples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>logLikelihoods</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>labels</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>probs</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, logLikelihoods, labels, probs</td><td>=</td><td>cv.ml_EM.trainEM(</td><td class="paramname">samples[, logLikelihoods[, labels[, probs]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Estimate the Gaussian mixture parameters from a samples set. </p>
<p>This variation starts with Expectation step. Initial values of the model parameters will be estimated by the k-means algorithm.</p>
<p>Unlike many of the ML models, EM is an unsupervised learning algorithm and it does not take responses (class labels or function values) as input. Instead, it computes the <em>Maximum Likelihood Estimate</em> of the Gaussian mixture parameters from an input sample set, stores all the parameters inside the structure: \(p_{i,k}\) in probs, \(a_k\) in means , \(S_k\) in covs[k], \(\pi_k\) in weights , and optionally computes the output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample).</p>
<p>The trained model can be used further for prediction, just like any other classifier. The trained model is similar to the <a class="el" href="../../d4/d8e/classcv_1_1ml_1_1NormalBayesClassifier.html" title="Bayes classifier for normally distributed data. ">NormalBayesClassifier</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">samples</td><td>Samples from which the Gaussian mixture model will be estimated. It should be a one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type it will be converted to the inner matrix of such type for the further computing. </td></tr>
    <tr><td class="paramname">logLikelihoods</td><td>The optional output matrix that contains a likelihood logarithm value for each sample. It has \(nsamples \times 1\) size and CV_64FC1 type. </td></tr>
    <tr><td class="paramname">labels</td><td>The optional output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample). It has \(nsamples \times 1\) size and CV_32SC1 type. </td></tr>
    <tr><td class="paramname">probs</td><td>The optional output matrix that contains posterior probabilities of each Gaussian mixture component given the each sample. It has \(nsamples \times nclusters\) size and CV_64FC1 type. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ac21fbae3a09972de0a0a1cb4c2c434d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac21fbae3a09972de0a0a1cb4c2c434d0">◆ </a></span>trainM()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool cv::ml::EM::trainM </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>samples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>probs0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>logLikelihoods</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>labels</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>probs</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, logLikelihoods, labels, probs</td><td>=</td><td>cv.ml_EM.trainM(</td><td class="paramname">samples, probs0[, logLikelihoods[, labels[, probs]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Estimate the Gaussian mixture parameters from a samples set. </p>
<p>This variation starts with Maximization step. You need to provide initial probabilities \(p_{i,k}\) to use this option.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">samples</td><td>Samples from which the Gaussian mixture model will be estimated. It should be a one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type it will be converted to the inner matrix of such type for the further computing. </td></tr>
    <tr><td class="paramname">probs0</td><td>the probabilities </td></tr>
    <tr><td class="paramname">logLikelihoods</td><td>The optional output matrix that contains a likelihood logarithm value for each sample. It has \(nsamples \times 1\) size and CV_64FC1 type. </td></tr>
    <tr><td class="paramname">labels</td><td>The optional output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample). It has \(nsamples \times 1\) size and CV_32SC1 type. </td></tr>
    <tr><td class="paramname">probs</td><td>The optional output matrix that contains posterior probabilities of each Gaussian mixture component given the each sample. It has \(nsamples \times nclusters\) size and CV_64FC1 type. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/<a class="el" href="../../d3/d29/ml_8hpp.html">ml.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:48 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
